import axiosServer from '../utils/request'
/**
 * 登录接口
 * @param {*} username
 * @param {*} password
 * @returns
 */
export const RequestLogin = (username, password) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/login',
    data: {
      username,
      password,
    },
  })
}
/**
添加管理员
 */
export const RequestonLogin = (formDate)=>{
  return axiosServer({
      method:'post',
      url:'/api/user/reqister',
      data:formDate
  })
}

//用户列表
export const userList=()=>{
    return axiosServer({
      method:'get',
      url:'/api/user/userlist',
  
    })
  }
  
//用户列表
export const userDelete=(_id)=>{
  return axiosServer({
    method:'get',
    url:'/api/user/userdelete',
    params: { _id },
  })
}

//修改个人信息
export const xguserlist = (_id, newnick, newgender, telephone, mail) => {
    return axiosServer({
        method: 'post',
        url: '/api/user/modify',
        data: {
            _id,
            newnick,
            newgender,
            telephone,
            mail
        }
    })
}